<?php
@session_start();
if (!isset($_SESSION['id_user']))
	//header('Location://localhost/firstclassapartmentscordoba/panel_control/login.php');
	//header('Location:http://firstclassapartment.com.ar/panel_control/login.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="es">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="Atenticaci&oacute;n | Panel de Control | First Class Apartments Cordoba Argentina">
		<meta name="author" content="Pulce Web Solutions - www.pulce.com.ar">
		<!--Para que las páginas se muestren correctamente y el zoom funcione bien en los dispositivos móviles-->
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="keywords" content="Departamento,Alquiler,Temporal,Cordoba,Capital,Argentina,First Class Apartments,Alojamiento,Turismo,Panel,Control,LogIn,Auenticaci&oacute;n">

		<title>Novedades | Panel de Control | First Class Apartments C&oacute;rdoba Argentina</title>

		<?php
			include_once('../links.php');
			include_once('menu_bar.php');
		?>
		<link href="../css/tooltipster.css" rel="stylesheet">
		<link href="../css/jquery.dataTables.css" rel="stylesheet">
		<link href="../css/dataTables.responsive.css" rel="stylesheet">

		<!--JQUERY-->
		<script src="http://code.jquery.com/jquery-2.1.0.js"></script>
		<!--BOOTSTRAP-->
		<script src="../js/bootstrap.min.js"></script>
		<!--CUSTOM JS-->
		<script src="../js/functions.js"></script>
		<!-- TOOLTIP -->
		<script src="../js/jquery.tooltipster.min.js"></script>
		<link href="../css/tooltipster.css" rel="stylesheet">
		<!-- DATATABLES -->
		<script src="../js/jquery.dataTables.js"></script>
		<!-- DATATABLES RESPONSIVE 
		<script src="../js/dataTables.responsive.js"></script>-->
		<!-- DATATABLES PLUGIN - DATE UK -->
		<script src="../js/date-uk.js"></script>
		<!-- DATATABLES PLUGIN - RELOAD AJAX -->
		<script src="../js/fnReloadAjax.js"></script>
		
		
		<script type="text/javascript">

		function reload(){
			var table = $('#tabla').dataTable();
			table.fnReloadAjax();
		}

		$(document).ready(function(){

			$('#tabla').dataTable({
				"language": {"url": "../css/es_ES.txt"},
	    		"ajax": {
		            "url": "ajax_tabla_novedades.php",
		            "dataSrc": ""
		        },
	        	"columns": [
		            { "data": "Leido" },
		            { "data": "Tipo" },
		            { "data": "Fecha" },
		            { "data": "Novedad" },
		            { "data": "Id" },
		            { "data": "Read" }
		        ],
		        "columnDefs": [
		        	{ 	"type": "date-uk", 
		        		"targets": 2 
		        	},
		        	{
		                "targets": 4,//Id
		                "visible": false,
		                "searchable": false
		            },
		            {
		                "targets": 5,//Read
		                "visible": false,
		                "searchable": false
		            }
		        ],
		         "bSort": false,
		         "rowCallback": function( row, data ) {              
					            	if ( data.Read == 1 )
					            		$('td', row).css('background-color', '#C5C5C5');
					            	else
					            		$('td', row).css('background-color', 'white');
									}
			});

			$('.tooltip').tooltipster({
                contentAsHTML: true
        	});

    		$('#btn-menu').on('click',function(e){
				$(location).attr('href','./index.php');
			});

		});


 	</script>

	</head>
	<body class="panel">
		<div class="container">
			<div class="box-central">
				<div class="row">
					<div class="col-xs-5">
						<h1>Novedades del Sistema</h1>
					</div>
					<div class="col-xs-2">
						<div id ="div-img">
						</div>
					</div>
				</div>
				<div class="back-table">
					<table id="tabla" class="display responsive nowrap">
						<thead>
				            <tr>
				                <th>Leido</th>
				                <th>Tipo</th>
				                <th>Fecha</th>
				                <th>Descripci&oacute;n</th>
				                <th>Id</th>
				                <th>Read</th>
				            </tr>
				        </thead>
					</table>
				</div>
				<div id="div-msg" class="margin-top-1em" style="display:none">
				</div>
				<div class="row margin-top-1em">
					<div class="col-xs-4 col-xs-offset-4">
						<button id="btn-menu" class="btn btn-lg btn-danger" style="width:90%">Volver al Men&uacute; Principal</button>
					</div>
				</div>
			</div>
			<div id="div-result">
			</div>
		</div>
	</body>
</html>